import 'dart:async';
import 'package:app_links/app_links.dart';

class AppLinksService {
  final AppLinks _appLinks = AppLinks();

  /// 合并冷启动 + 热启动
  Stream<Uri> get allLinksStream async* {
    final initial = await _appLinks.getInitialLink();
    if (initial != null) yield initial;

    yield* _appLinks.uriLinkStream;
  }
}
